<?php
	require_once '../func/admin_func.php';
	$teacher = new admin();
	if(isset($_POST['pager'])){
		$pager = $_POST['pager'];
	}else{
		$pager = 1;
	}
	$data = $teacher->GetTeacherList($pager);
	$n = count($data);
	$i = 0;
?>

<div id="main-wrapper">

<h1>教师信息管理</h1>
<a class="search-button" href="#">高级搜索</a><div class="search-form" style="display: none;">
<div class="wide form">
</div>
</div>
<div id="user-account-grid" class="grid-view">
<div class="summary">共<?php echo $m =  $teacher->info_count('student');?>条.</div>
<table class="items">
<thead>
<tr>
	<th  width="15%"></th>
	<th id="user-account-grid_c0" width="15%"><a href="">ID</a></th>
	<th id="user-account-grid_c1" width="15%"><a href="">姓名</a></th>
	<th id="user-account-grid_c2" width="15%"><a href="">身份证</a></th>
	<th id="user-account-grid_c3" width="15%"><a href="">创建时间</a></th>
	<th id="user-account-grid_c4" width="20%"><a href="">操作</a></th>
</tr>
</thead>
<tbody id="tbody">
<?php
	while($i<$n){
?>
<tr class="<?php if($i%2==0){echo "even";}else{echo "odd";}?>">
<td></td>
<td><?php echo $data[$i]['id'];?></td>
<td><?php echo $data[$i]['t_name'];?></td>
<td><?php echo $data[$i]['c_id'];?></td>
<td><?php echo $data[$i]['creat_time'];?></td>
<td>
<a class="update" title="更新" href="#" onclick="operate('teacher',<?php echo $data[$i]['id'].",".$pager;?>,'update')"><img src="./images/update.png" alt="更新"></a> 
<a class="delete" title="删除" href="#" onclick="operate('teacher',<?php echo $data[$i]['id'].",".$pager;?>,'del')" ><img src="./images/delete.png" alt="删除"></a></td></tr>
<?php $i++;}?>
</tbody>
</table>
<div class="pager">
<script>$('.pager').load("./pager.php",{type:'teacher',pager:<?php echo $pager;?>}); </script>
</div>	
</div>